<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript">
		window.onload=function(){
			setInterval(function(){
				var date=new Date()
				var year=date.getFullYear()
				var month=date.getMonth()+1
				var date1=date.getDate()
				var week=date.getDay()
				var hour=date.getHours()
				var minte=date.getMinutes()
				var second=date.getSeconds()
				switch(week){
					case 0:
					week='天'
					break;

					case 1:
					week='一'
					break;

					case 2:
					week='二'

					case 3:
					week='三'
					break;

					case 4:
					week='四'
					break;

					case 5:
					week='五'
					break;

					case 6:
					week='六'
					break;
				}

		       var str='今天是'+year+'年'+month+'月'+date1+'日'+'周'+week+','+time(hour)+':'+fn(minte)+':'+fn(second);
		       
		       document.getElementById('ti').innerText=str
		},1000)
			function fn(num){
				return num<10? '0'+num:num+''

			}
			function time(num1){
				if (num1<6) {return '凌晨:'+'0'+num1}
				else if (num1<=8) {return '早晨:'+'0'+num1}
				else if (num1<10) {return '上午：'+'0'+num1}
				else if (num1<=12) {return '上午：'+num1}
					else if(num1<=18){return'下午：'+'0'+(num1-12)}
						else if(num1<22){return '晚上：'+'0'+(num1-12)}
							else{return'晚上：'+(num1-12)}

				
			}

			
				
			}
		
		
		
				

			
	</script>
</head>
<body>
	<h id="ti"></h>
</body>
</html>